<%--
    Document   : XemDanhSachNhanVien
    Created on : May 31, 2014, 3:22:31 PM
    Author     : bienphongvnn
--%>
<%@page import="javax.servlet.http.HttpServlet" %>
<%@page import="Data.KhachHang"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Model.KhachHangModel"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Danh sách khách hàng</title>
        <link id="theme" rel="stylesheet" type="text/css" href="css/dinhdang.css" title="theme" />
        <link id="theme" rel="stylesheet" type="text/css" href="css/style.css" title="theme" />
        <link href="bootstrap-3.1.1-dist/bootstrap-3.1.1-dist/css/bootstrap.css" rel="stylesheet"/>
        <link href="css/carousel.css" rel="stylesheet"/>
    </head>
    <body>
        <div id="wrapper">
            <div class = "bd" class="lichsu">
                <div id = "page">
                    <div id="container">
                        <!-- Công nghệ bootstrap -->
                        <div id="myCarousel" class="carousel slide" data-ride="carousel">
                            <!-- Indicators -->
                            <ol class="carousel-indicators">
                                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                                <li data-target="#myCarousel" data-slide-to="1"></li>
                                <li data-target="#myCarousel" data-slide-to="2"></li>
                                <li data-target="#myCarousel" data-slide-to="3"></li>
                            </ol>
                            <!--Hình thứ nhất -->
                            <div class="carousel-inner">
                                <div class="item active">
                                    <img src = "images/Information.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1>WELCOME TO VNRAILWAY</h1>
                                        </div>
                                    </div>
                                </div>
                                <!--Hình thứ 2 -->
                                <div class="item">
                                    <img src = "images/informationtechnology1.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1 class="dangnhap">INFORMATION TECHNOLOGY</h1>
                                        </div>
                                    </div>
                                </div>
                                <!--Hình thứ 3 -->
                                <div class="item">
                                    <img src = "images/informationtechnology2.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1 class="dangnhap">WELCOME TO VNRAILWAY</h1>
                                        </div>
                                    </div>
                                </div>
                                <!--Hình thứ 4 -->
                                <div class="item">
                                    <img src = "images/informationtechnology3.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1 class="dangnhap">INFORMATION TECHNOLOGY</h1>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
                            <a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
                        </div><!-- /.carousel -->
                        <div class="bd">
                            <div align = "center">
                                <h1  class = "lichsu">DANH SÁCH KHÁCH HÀNG</h1>
                                <br><hr>
                                <form	method="post">	
                                    Từ	khoá:	<input	type="text" name="keyword" placeholder="Tên đăng nhập" required autofocus/>	
                                    <input type="submit" value="Tìm kiếm"/>	
                                </form>
                                <br>
                                <%	String keyword = request.getParameter("keyword");
                                    if (keyword != null && keyword != "") {
                                %>
                                <table width="960" border="1" bgcolor="#669900">
                                    <tr>
                                        <td>STT</td> <td>Tên đăng nhập</td> <td>Họ tên</td> <td>CMND</td> <td>Ngày sinh</td> 
                                        <td>Giới tính</td> <td>Địa chỉ</td> <td>Điện thoại</td> <td>Email</td> <td>Mật khẩu</td> <td>Xác nhận mật khẩu</td>
                                    </tr>
                                    <%
                                        ArrayList<KhachHang> arr = KhachHangModel.TimKiemTatCa(keyword);
                                        int j = 0;
                                        for (KhachHang n : arr) {
                                            j++;

                                    %>
                                    <tr>
                                        <td><%= j%></td>
                                        <td><%= n.getTenDangNhap()%></td>
                                        <td><%= n.getHoTen()%></td>
                                        <td><%= n.getCMND()%></td>
                                        <td><%= n.getNgaySinh()%></td>
                                        <td><%= n.getGioiTinh()%></td>
                                        <td><%= n.getDiaChi()%></td>
                                        <td><%= n.getDienThoai()%></td>
                                        <td><%= n.getEmail()%></td>
                                        <td><%= n.getMatKhau()%></td>
                                        <td><%= n.getXacNhanMatKhau()%></td>
                                    </tr>
                                    <% }%>
                                </table>
                                <% }%>
                                <br><hr>
                                <table width="960" border="1" solid black>
                                    <tr>
                                        <td>STT</td> <td>Tên đăng nhập</td> <td>Họ tên</td> <td>CMND</td> <td>Ngày sinh</td> 
                                        <td>Giới tính</td> <td>Địa chỉ</td> <td>Điện thoại</td> <td>Email</td> <td>Mật khẩu</td> <td>Xác nhận mật khẩu</td>
                                    </tr>
                                    <%
                                        ArrayList<KhachHang> arr = KhachHangModel.ListKhachHang();
                                        int i = 0;
                                        for (KhachHang n : arr) {
                                            i++;

                                    %>
                                    <tr>
                                        <td><%= i%></td>
                                        <td><%= n.getTenDangNhap()%></td>
                                        <td><%= n.getHoTen()%></td>
                                        <td><%= n.getCMND()%></td>
                                        <td><%= n.getNgaySinh()%></td>
                                        <td><%= n.getGioiTinh()%></td>
                                        <td><%= n.getDiaChi()%></td>
                                        <td><%= n.getDienThoai()%></td>
                                        <td><%= n.getEmail()%></td>
                                        <td><%= n.getMatKhau()%></td>
                                        <td><%= n.getXacNhanMatKhau()%></td>
                                    </tr>
                                    <% }%>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="bd">

                    </div>
                    <div class="ft"> 
                        <div id="footer"> 
                            <div class="content"> 
                                <p>Thank you for your coming!!! 
                                </p> 
                            </div> 
                        </div>  
                        <div id="container-bottom"></div> 
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>	
        <script src="bootstrap-3.1.1-dist/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
        <script src="bootstrap-3.1.1-dist/bootstrap-3.1.1-dist/assets/js/docs.min.js"></script>
    </body>
</html>
